#include <stdio.h>
#include <ctype.h>

int main(){
    char first_ch = 0, ch;

    printf("Enter a first and last name: ");
    while ((ch = getchar()) == ' ') ;
    first_ch = toupper(ch);

    while (getchar() != ' ') ; // read whole first name
    while ((ch = getchar()) == ' ');

    do {
        putchar(ch);
    } while ((ch = getchar()) != '\n' && ch != ' ');

    printf(", %c.\n", first_ch);

    return 0;
}
